<?php
class excels extends Model {
    
    function reports($id){
        set_time_limit(3360);   
		$objPHPExcel = new PHPExcel();
        $objPHPExcel->getProperties()->setTitle("title")
                    ->setDescription("description");
		$objPHPExcel->setActiveSheetIndex(0);
        
		$objPHPExcel->getActiveSheet()->getPageSetup()->setOrientation(Worksheet_PageSetup::ORIENTATION_PORTRAIT);
        $objPHPExcel->getActiveSheet()->getPageSetup()->setPaperSize(Worksheet_PageSetup::PAPERSIZE_A4);
        $objPHPExcel->getActiveSheet()->getPageMargins()->setTop(0.75);
        $objPHPExcel->getActiveSheet()->getPageMargins()->setRight(0.50);
        $objPHPExcel->getActiveSheet()->getPageMargins()->setLeft(0.50);
        $objPHPExcel->getActiveSheet()->getPageMargins()->setBottom(1);
        $objPHPExcel->getActiveSheet()->getPageSetup()->setScale(75);
		
        $styleArray = array( 'borders' => array( 'allborders' => array(
                             'style' => Style_Border::BORDER_THIN )));
		$styleArray2 = array( 'borders' => array( 'right' => array(
                             'style' => Style_Border::BORDER_THIN )));
        $styleArray3 = array( 'borders' => array( 'bottom' => array(
                             'style' => Style_Border::BORDER_THIN )));								 
        $fill = array(
      			'type'       => Style_Fill::FILL_SOLID,
      			'rotation'   => 0,
      			'startcolor' => array(
      				'rgb' => '0000A0'
      			),
      			'endcolor'   => array(
      				'argb' => '0000A0'
      			)
      		);                     
		/*Data */
		$row=1;
		$col=0;
		$this->db->select('*,j.id,j.no');
		$this->db->where('j.id',$id);
		$this->db->join('customers c','c.id=j.customer_id');
		$this->db->join('products p','p.id=j.product_id');
		$this->db->join('banks b','b.id=j.bank_id');
		$this->db->join('customer_sector cs','cs.id=c.sector_id','LEFT');
		$Q=$this->db->get('jobs j');
		$value=$Q->row_array();
		
		$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col)->setWidth(2);
		
		/*for($i=1;$i<=57;$i++):
			$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow(12,$i)->applyFromArray($styleArray2);
		endfor;
		
		for($i=0;$i<=12;$i++):
			$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($i,57)->applyFromArray($styleArray3);
		endfor;*/
		
		$col=$col+1;
		/* No */
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col,$row,'JOB ORDER');
		$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col)->setWidth(12);
        //$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFill()->applyFromArray($fill);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFont()
																		 ->setName('Calibri')
																		 ->setBold(true)
																		 ->setSize(14);

		
		/* No */
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+1,$row,$value['no']);
		$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+1)->setWidth(10);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+1,$row)->getFont()
																		 ->setName('Calibri')
																		 ->setBold(true)
																		 ->setSize(14);
        
		$row=$row+2;
		/* Type */
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col,$row,'Jenis');
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col)->setWidth(10);
        //$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFill()->applyFromArray($fill);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFont()
																		 ->setName('Calibri')
																		 ->setBold(true)
																		 ->setSize(11);
		/* Type */
		
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+1,$row,$value['job_type']);
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+1)->setWidth(8);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+1,$row)->applyFromArray($styleArray);
        $objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+1,$row)->getFont()
																		 ->setName('Calibri')
																		 ->setBold(true)
																		 ->setSize(11);
		$row=$row+1;
		/* Order */ 
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col,$row,'First Order');
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col)->setWidth(10);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFont()
																		 ->setName('Calibri')
																		 ->setBold(true)
																		 ->setSize(11);
		if($value['order_type']=="First Order"):
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+1,$row,'V');
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+1,$row)->getFont()
																		 ->setName('Calibri')
																		 ->setBold(true)
																		 ->setSize(11);
		endif;
		
        $objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+1)->setWidth(8);
        $objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+1,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+1,$row)->getFill()->applyFromArray($fill);
		
        
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+3,$row,'Repeat Order');
		$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+3)->setWidth(10);
        $objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+3,$row)->getFont()
																		 ->setName('Calibri')
																		 ->setBold(true)
																		 ->setSize(11);
																		 
		if($value['order_type']=="Repeat Order"):
		  $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+4,$row,'V');
		  $objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+4,$row)->getFont()
																		 ->setName('Calibri')
																		 ->setBold(true)
																		 ->setSize(11);
		endif;
        
		$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+4)->setWidth(8);
        $objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+4,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+4,$row)->getFill()->applyFromArray($fill);
		
		
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+6,$row,'Incoming');
		$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+6)->setWidth(10);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+6,$row)->getFont()
																		 ->setName('Calibri')
																		 ->setBold(true)
																		 ->setSize(11);
        
		if($value['coming_type']=="Incoming"):
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+7,$row,'V');
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+7,$row)->getFont()
																		 ->setName('Calibri')
																		 ->setBold(true)
																		 ->setSize(11);
		endif;
        
		$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+7)->setWidth(8);
        $objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+7,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+7,$row)->getFill()->applyFromArray($fill);
		
		
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+9,$row,'Non Incoming');
		$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+9)->setWidth(13);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+9,$row)->getFont()
																		 ->setName('Calibri')
																		 ->setBold(true)
																		 ->setSize(11);
        
		if($value['coming_type']=="Non Incoming"):
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+10,$row,'V');
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+10,$row)->getFont()
																		 ->setName('Calibri')
																		 ->setBold(true)
																		 ->setSize(11);
		endif;
        
		$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+10)->setWidth(8);
        $objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+10,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+10,$row)->getFill()->applyFromArray($fill);
		
		$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+11)->setWidth(2);
		
		$row=$row+2;
		/* Perusahaan */
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col,$row,'Perusahaan');
		$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col)->setWidth(15);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFont()
																		 ->setName('Calibri')
																		 ->setBold(true)
																		 ->setSize(11);
        //$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFill()->applyFromArray($fill);
		/* Perusahaan */
		
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+1,$row,$value['customer_name']);
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+1)->setWidth(35);
		$objPHPExcel->getActiveSheet()->mergeCells('C6:L6');
        
		$row=$row+1;
		/* Jenis Usaha */
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col,$row,'Jenis Usaha');
		$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col)->setWidth(15);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFont()
																		 ->setName('Calibri')
																		 ->setBold(true)
																		 ->setSize(11);
        //$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFill()->applyFromArray($fill);
		$objPHPExcel->getActiveSheet()->mergeCells('C7:H7');
		/* Jenis Usaha */
		
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+1,$row,$value['sector_name']);
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+1)->setWidth(20);
        
		$row=$row+1;
		/* Alamat */
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col,$row,'Alamat');
		$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col)->setWidth(15);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFont()
																		 ->setName('Calibri')
																		 ->setBold(true)
																		 ->setSize(11);
		$objPHPExcel->getActiveSheet()->mergeCells('C8:M8');																 
        //$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFill()->applyFromArray($fill);
		/* Alamat */
		
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+1,$row,$value['address']);
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+1)->setWidth(35);
        
		$row=$row+1;
		/* Telp */
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col,$row,'Telepon');
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col)->setWidth(15);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFont()
																		 ->setName('Calibri')
																		 ->setBold(true)
																		 ->setSize(11);
        //$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFill()->applyFromArray($fill);
		/* Telp */
		
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+1,$row,$value['tlp']);
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+1)->setWidth(20);
        
		$row=$row+1;
		/* Fax */
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col,$row,'Faximile');
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col)->setWidth(15);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFont()
																		 ->setName('Calibri')
																		 ->setBold(true)
																		 ->setSize(11);
        //$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFill()->applyFromArray($fill);
		/* Fax */
		
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+1,$row,$value['fax']);
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+1)->setWidth(20);
        
		$row=$row+2;
		/* Produk */
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col,$row,'Produk');
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col)->setWidth(15);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFont()
																		 ->setName('Calibri')
																		 ->setBold(true)
																		 ->setSize(11);
        //$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFill()->applyFromArray($fill);
		/* Produk */
		$row=$row+1;
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+1,$row,$value['product_name']);
		$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+1)->setWidth(8);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+1,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+2,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+3,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+4,$row)->applyFromArray($styleArray);
        $objPHPExcel->getActiveSheet()->mergeCells('C13:F13');
		
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+5,$row,$value['invest']);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+5,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+6,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+7,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+8,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+2)->setWidth(10);
        
		$objPHPExcel->getActiveSheet()->mergeCells('G13:I13');
		
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+8,$row,$value['product_time']);
		$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+8)->setWidth(10);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+8,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+9,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+10,$row)->applyFromArray($styleArray);
        $objPHPExcel->getActiveSheet()->mergeCells('J13:L13');
		
		$row=$row+1;
		/* Product Invest*/
		 $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col,$row,'Investasi');
		 $objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFont()
																		 ->setName('Calibri')
																		 ->setBold(true)
																		 ->setSize(11);
		
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col)->setWidth(15);
        //$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFill()->applyFromArray($fill);
		/* Product Invest*/
		
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+1,$row,$value['invest']);
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+1)->setWidth(20);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+1,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+2,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+3,$row)->applyFromArray($styleArray);
        $objPHPExcel->getActiveSheet()->mergeCells('C14:E14');
		
		$row=$row+1;
		/* Product Doisokon*/
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col,$row,'Diskon');
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col)->setWidth(15);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFont()
																		 ->setName('Calibri')
																		 ->setBold(true)
																		 ->setSize(11);
        //$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFill()->applyFromArray($fill);
		/* Product Diskon*/
		
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+1,$row,$value['discount']);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+1,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+2,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+3,$row)->applyFromArray($styleArray);
        $objPHPExcel->getActiveSheet()->mergeCells('C15:E15');
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+1)->setWidth(20);
        
		$row=$row+2;
		/* PPN*/
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col,$row,'PPN 10%');
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFont()
																		 ->setName('Calibri')
																		 ->setBold(true)
																		 ->setSize(11);
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col)->setWidth(15);
        //$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFill()->applyFromArray($fill);
		/* PPN*/
		
		if($value['ppn']==10):
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+1,$row,'V');
		endif;
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+1)->setWidth(10);
        $objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+1,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+1,$row)->getFill()->applyFromArray($fill);
		
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+3,$row,'Rp.');
		
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+4,$row,($value['invest'] * $value['ppn'])/100 );
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+2)->setWidth(20);
        $objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+4,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+5,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+6,$row)->applyFromArray($styleArray);
	    $objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+7,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->mergeCells('F17:I17');
		
		
		
		$row=$row+2;
		/* Product Bank*/
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col,$row,'Bank');
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col)->setWidth(15);
        $objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFont()
																		 ->setName('Calibri')
																		 ->setBold(true)
																		 ->setSize(11);
		//$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFill()->applyFromArray($fill);
		
		$row=$row+1;
		
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+1,$row,$value['bank_name']);
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+1)->setWidth(20);
        $objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+1,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+2,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+3,$row)->applyFromArray($styleArray);
	
		$objPHPExcel->getActiveSheet()->mergeCells('C20:E20');
		/* Product Bank*/
		
		$row=$row+2;
		/* Tanggal Mulai*/
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col,$row,'Tanggal Mulai');
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFont()
																		 ->setName('Calibri')
																		 ->setBold(true)
																		 ->setSize(11);
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col)->setWidth(15);
        //$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFill()->applyFromArray($fill);
		
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+1,$row,$value['date_in']);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+1,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+2,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->mergeCells('C22:D22');
		
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+1)->setWidth(20);
		/* Tanggal Mulai */
		
		$row=$row+1;
		/* Tanggal Selesai*/
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col,$row,'Tanggal Selesai');
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFont()
																		 ->setName('Calibri')
																		 ->setBold(true)
																		 ->setSize(11);
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col)->setWidth(15);
        //$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFill()->applyFromArray($fill);
		
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+1,$row,$value['date_out']);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+1,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+2,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->mergeCells('C23:D23');
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+1)->setWidth(20);
        
        /* Tanggal Selesai */
        
        	$row=$row+1;
		/* Jumlah Jam*/
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col,$row,'Jam');
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFont()
																		 ->setName('Calibri')
																		 ->setBold(true)
																		 ->setSize(11);
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col)->setWidth(15);
        //$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFill()->applyFromArray($fill);
		
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+1,$row,$value['hour_one'].'-'.$value['hour_two']);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+1,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+2,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->mergeCells('C23:D23');
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+1)->setWidth(20);
        //$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+3,$row,'Orang');
        
        
		/* Jumlah Pserta */
        
		/* Tanggal Selesai */
        
        	$row=$row+1;
		/* Jumlah Peserta*/
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col,$row,'Jumlah Peserta');
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFont()
																		 ->setName('Calibri')
																		 ->setBold(true)
																		 ->setSize(11);
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col)->setWidth(15);
        //$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFill()->applyFromArray($fill);
		
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+1,$row,$value['human_total']);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+1,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+2,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->mergeCells('C23:D23');
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+1)->setWidth(20);
        $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+3,$row,'Orang');
        
        
		/* Jumlah Pserta */
		
		$row=$row+1;
		/* Lokasi*/
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col,$row,'Lokasi Pelatihan');
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFont()
																		 ->setName('Calibri')
																		 ->setBold(true)
																		 ->setSize(11);
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col)->setWidth(15);
        //$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFill()->applyFromArray($fill);
		
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+1,$row,$value['location']);
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+1)->setWidth(20);
        $objPHPExcel->getActiveSheet()->mergeCells('C24:L24');
		for($i=1;$i<=10;$i++):
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+$i,$row)->applyFromArray($styleArray);
		endfor;
		/* Lokasi*/
		
		$row=$row+2;
		/* SDM*/
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col,$row,'Kontak SDM');
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFont()
																		 ->setName('Calibri')
																		 ->setBold(true)
																		 ->setSize(11);
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col)->setWidth(15);
        //$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFill()->applyFromArray($fill);
		
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+1,$row,$value['sdm_contact']);
		$objPHPExcel->getActiveSheet()->mergeCells('C26:E26');
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+1,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+2,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+3,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+1)->setWidth(20);
        
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+5,$row,'Jabatan');
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+5,$row)->getFont()
																		 ->setName('Calibri')
																		 ->setBold(true)
																		 ->setSize(11);
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+5)->setWidth(15);
        //$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+5,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+5,$row)->getFill()->applyFromArray($fill);
		
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+6,$row,$value['sdm_pos']);
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+4)->setWidth(20);
        $objPHPExcel->getActiveSheet()->mergeCells('H26:J26');
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+6,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+7,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+8,$row)->applyFromArray($styleArray);
		/* SDM*/
		
		$row=$row+1;
		/* SDM Contact*/
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col,$row,'Telepon');
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFont()
																		 ->setName('Calibri')
																		 ->setBold(true)
																		 ->setSize(11);
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col)->setWidth(15);
        //$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFill()->applyFromArray($fill);
		
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+1,$row,$value['sdm_telp']);
		$objPHPExcel->getActiveSheet()->mergeCells('C27:E27');
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+1,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+2,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+3,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+1)->setWidth(20);
        
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+5,$row,'Fax');
        $objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+5,$row)->getFont()
																		 ->setName('Calibri')
																		 ->setBold(true)
																		 ->setSize(11);

		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+2)->setWidth(15);
        //$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+2,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+2,$row)->getFill()->applyFromArray($fill);
		
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+6,$row,$value['sdm_fax']);
		$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+6)->setWidth(20);
        $objPHPExcel->getActiveSheet()->mergeCells('H27:J27');
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+6,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+7,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+8,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+8,$row,'Fax');
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+4)->setWidth(15);
        //$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+4,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+4,$row)->getFill()->applyFromArray($fill);
		
		//$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+9,$row,$value['sdm_fax']);
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+5)->setWidth(20);
        
		
		/* SDM Contact*/
		$row=$row+2;
		/* Techic*/
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col,$row,'Kontak Teknis');
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFont()
																		 ->setName('Calibri')
																		 ->setBold(true)
																		 ->setSize(11);
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col)->setWidth(15);
        //$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFill()->applyFromArray($fill);
		
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+1,$row,$value['technic_contact']);
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+1)->setWidth(20);
		$objPHPExcel->getActiveSheet()->mergeCells('C29:E29');
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+1,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+2,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+3,$row)->applyFromArray($styleArray);
        
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+5,$row,'Jabatan');
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+5,$row)->getFont()
																		 ->setName('Calibri')
																		 ->setBold(true)
																		 ->setSize(11);
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+5)->setWidth(15);
        //$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+5,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+5,$row)->getFill()->applyFromArray($fill);
		
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+6,$row,$value['technic_pos']);
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+4)->setWidth(20);
        $objPHPExcel->getActiveSheet()->mergeCells('H29:J29');
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+6,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+7,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+8,$row)->applyFromArray($styleArray);
        
		/* Technic*/
		
		$row=$row+1;
		/* Technic Contact*/
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col,$row,'Telepon');
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFont()
																		 ->setName('Calibri')
																		 ->setBold(true)
																		 ->setSize(11);
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col)->setWidth(15);
        //$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFill()->applyFromArray($fill);
		
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+1,$row,$value['technic_telp']);
		$objPHPExcel->getActiveSheet()->mergeCells('C30:E30');
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+1,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+2,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+3,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+1)->setWidth(20);
        
		//$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+2,$row,'HP');
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+2)->setWidth(15);
        //$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+2,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+2,$row)->getFill()->applyFromArray($fill);
		
		//$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+3,$row,$value['technic_hp']);
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+3)->setWidth(20);
        
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+5,$row,'Fax');
        $objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFont()
																		 ->setName('Calibri')
																		 ->setBold(true)
																		 ->setSize(11);

		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+4)->setWidth(15);
        //$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+4,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+4,$row)->getFill()->applyFromArray($fill);
		
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+6,$row,$value['technic_fax']);
		$objPHPExcel->getActiveSheet()->mergeCells('H30:J30');
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+6,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+7,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+8,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+5)->setWidth(20);
		/* Techic Contact*/
		
		$row=$row+2;
		/* acc*/
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col,$row,'Kontak Keuangan');
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFont()
																		 ->setName('Calibri')
																		 ->setBold(true)
																		 ->setSize(11);
										 
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col)->setWidth(15);
        //$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFill()->applyFromArray($fill);
		
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+1,$row,$value['acc_contact']);
		$objPHPExcel->getActiveSheet()->mergeCells('C32:E32');
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+1,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+2,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+3,$row)->applyFromArray($styleArray);
        								
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+1)->setWidth(20);
        
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+5,$row,'Jabatan');
        $objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFont()
																		 ->setName('Calibri')
																		 ->setBold(true)
																		 ->setSize(11);

			
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+3)->setWidth(15);
        //$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+3,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+3,$row)->getFill()->applyFromArray($fill);
		
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+6,$row,$value['acc_pos']);
		$objPHPExcel->getActiveSheet()->mergeCells('H32:J32');
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+6,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+7,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+8,$row)->applyFromArray($styleArray);
        							
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+4)->setWidth(20);
        
		/* acc*/
		
		$row=$row+1;
		/* acc Contact*/
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col,$row,'Telepon');
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFont()
																		 ->setName('Calibri')
																		 ->setBold(true)
																		 ->setSize(11);
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col)->setWidth(15);
        //$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFill()->applyFromArray($fill);
		
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+1,$row,$value['acc_telp']);
		$objPHPExcel->getActiveSheet()->mergeCells('C33:E33');
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+1,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+2,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+3,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+1)->setWidth(20);
        
		//$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+2,$row,'HP');
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+2)->setWidth(15);
        //$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+2,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+2,$row)->getFill()->applyFromArray($fill);
		
		//$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+3,$row,$value['acc_hp']);
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+3)->setWidth(20);
        
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+5,$row,'Fax');
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+5,$row)->getFont()
																		 ->setName('Calibri')
																		 ->setBold(true)
																		 ->setSize(11);
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+4)->setWidth(15);
        //$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+4,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+4,$row)->getFill()->applyFromArray($fill);
		
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+6,$row,$value['acc_fax']);
		$objPHPExcel->getActiveSheet()->mergeCells('H33:J33');
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+6,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+7,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+8,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+5)->setWidth(20);
        
		
		/* acc Contact*/
		
		$row=$row+2;
		/* Fac*/
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col,$row,'Fasilitas Dari Klien:');
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFont()
																		 ->setName('Calibri')
																		 ->setBold(true)
																		 ->setSize(11);

        $objPHPExcel->getActiveSheet()->mergeCells('B35:C35');
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col)->setWidth(15);
        //$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFill()->applyFromArray($fill);
		/* Fac*/
		
		$Q=$this->db->get('facilitas',8);
		$fac=$Q->result_array();
		foreach($fac as $val):
			$row=$row+1;
		/* Fac*/
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+2,$row,$val['fac_name']);
		$objPHPExcel->getActiveSheet()->mergeCells('D36:F36');
		$objPHPExcel->getActiveSheet()->mergeCells('D37:F37');
		$objPHPExcel->getActiveSheet()->mergeCells('D38:F38');
		$objPHPExcel->getActiveSheet()->mergeCells('D39:F39');
		$objPHPExcel->getActiveSheet()->mergeCells('D40:F40');
		$objPHPExcel->getActiveSheet()->mergeCells('D41:F41');
		$objPHPExcel->getActiveSheet()->mergeCells('D42:F42');
		$objPHPExcel->getActiveSheet()->mergeCells('D43:F43');
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+1)->setWidth(15);
        
		$this->db->where('job_no',$id);
		$this->db->where('fac_id',$val['id']);
		$Q=$this->db->get('job_facilitas');
		$v=$Q->row_array();
		
		if(COUNT($v)>=1):
			$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+1,$row,'V');
		endif;
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+1,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+1,$row)->getFill()->applyFromArray($fill);
		/* Fac*/
		
		endforeach;
		
		$Q=$this->db->get('facilitas',7,8);
		$fac=$Q->result_array();
		$row=$row-7;
		foreach($fac as $val):
		$row=$row+1;
			//$row=$row+1;
		/* Fac*/
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+6,$row,$val['fac_name']);
		$objPHPExcel->getActiveSheet()->mergeCells('H36:J36');
		$objPHPExcel->getActiveSheet()->mergeCells('H37:J37');
		$objPHPExcel->getActiveSheet()->mergeCells('H38:J38');
		$objPHPExcel->getActiveSheet()->mergeCells('H39:J39');
		$objPHPExcel->getActiveSheet()->mergeCells('H40:J40');
		$objPHPExcel->getActiveSheet()->mergeCells('H41:J41');
		$objPHPExcel->getActiveSheet()->mergeCells('H42:J42');
		$objPHPExcel->getActiveSheet()->mergeCells('H43:J43');
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+3)->setWidth(15);
        
		$this->db->where('job_no',$id);
		$this->db->where('fac_id',$val['id']);
		$Q=$this->db->get('job_facilitas');
		$v=$Q->row_array();
		
		if(COUNT($v)>=1):
			$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+5,$row,'V');
		endif;
		
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+5,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+5,$row)->getFill()->applyFromArray($fill);
		/* Fac*/
		endforeach;
		
        $row=$row+2;
		/* Tanggal Selesai*/
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col,$row,'Trainer');
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFont()
																		 ->setName('Calibri')
																		 ->setBold(true)
																		 ->setSize(11);
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col)->setWidth(15);
        //$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFill()->applyFromArray($fill);
		
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+1,$row,$value['trainer']);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+1,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+2,$row)->applyFromArray($styleArray);
        $objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+3,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+4,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->mergeCells('C48:F48');
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+1)->setWidth(20);
        
        /* Tanggal Selesai */
        
		$row=$row+1;
		/* Message*/
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col,$row,'Pesan Khusus Dari Klien');
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFont()
																		 ->setName('Calibri')
																		 ->setBold(true)
																		 ->setSize(11);
        $objPHPExcel->getActiveSheet()->mergeCells('C47:F47');                                                                 
        //$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col)->setWidth(15);
        //$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFill()->applyFromArray($fill);
		$row=$row+1;
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col,$row,$value['message']);
		//$objPHPExcel->getActiveSheet()->mergeCells('B46:L47');
		//$objPHPExcel->getActiveSheet()->mergeCells('H37:J37');
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+1)->setWidth(20);
		/* Message*/
		
		$row=$row+2;
		/* Inforamtion*/
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col,$row,'Informasi Tambahan');
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFont()
																		 ->setName('Calibri')
																		 ->setBold(true)
																		 ->setSize(11);
                                                                         
        $row=$row+1;
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col)->setWidth(15);
        //$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFill()->applyFromArray($fill);
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col,$row,$value['information']);
																		 
        $objPHPExcel->getActiveSheet()->mergeCells('B52:L53');
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+1)->setWidth(20);
        
		/* Information*/
		
		$row=$row+3;
		/* Approval*/
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col,$row,'Tanggal Posting');
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFont()
																		 ->setName('Calibri')
																		 ->setBold(true)
																		 ->setSize(11);
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col)->setWidth(15);
        //$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row)->getFill()->applyFromArray($fill);
		
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+2,$row,'Dibuat');
        $objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+2,$row)->getFont()
																		 ->setName('Calibri')
																		 ->setBold(true)
																		 ->setSize(11);
		$objPHPExcel->getActiveSheet()->mergeCells('D52:E52');
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+2,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+3,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->mergeCells('D53:E53');
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+2)->setWidth(15);
        //$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+2,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+2,$row)->getFill()->applyFromArray($fill);
		
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+4,$row,'Mengetahui');
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+4,$row)->getFont()
																		 ->setName('Calibri')
																		 ->setBold(true)
																		 ->setSize(11);
        $objPHPExcel->getActiveSheet()->mergeCells('F52:G52');
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+4,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+5,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->mergeCells('F53:G53');
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+4)->setWidth(15);
        //$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+3,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+3,$row)->getFill()->applyFromArray($fill);
		
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+6,$row,'Diterima');
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+6,$row)->getFont()
																		 ->setName('Calibri')
																		 ->setBold(true)
																		 ->setSize(11);
        $objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+6,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->mergeCells('F52:G52');
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+4)->setWidth(15);
        //$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+4,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+4,$row)->getFill()->applyFromArray($fill);
		
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+7,$row,'Diterima');
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+7,$row)->getFont()
																		 ->setName('Calibri')
																		 ->setBold(true)
																		 ->setSize(11);
        $objPHPExcel->getActiveSheet()->mergeCells('I52:J52');
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+7,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+8,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->mergeCells('I53:J53');
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+5)->setWidth(15);
        //$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+5,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+5,$row)->getFill()->applyFromArray($fill);
		
		
		/* Approval*/
		
		$row=$row+4;
		/* Approval*/
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col,$row-1,$value['date_posting']);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col,$row-1)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col)->setWidth(15);
        
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+2,$row,'Training Advisor');
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+2,$row)->applyFromArray($styleArray);
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+2)->setWidth(15);
        $objPHPExcel->getActiveSheet()->mergeCells('D56:E56');
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+2,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+3,$row)->applyFromArray($styleArray);
		
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+4,$row,'Deputy');
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+4,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->mergeCells('F56:G56');
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+4,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+5,$row)->applyFromArray($styleArray);
		
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+3)->setWidth(15);
        
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+6,$row,'Head');
        $objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+6,$row)->getFont()
																		 ->setName('Calibri')
																		 ->setBold(true)
																		 ->setSize(11);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+6,$row)->applyFromArray($styleArray);

		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+4)->setWidth(15);
        
		$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col+7,$row,'Keuangan');
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+7,$row)->getFont()
																		 ->setName('Calibri')
																		 ->setBold(true)
																		 ->setSize(11);
        $objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+7,$row)->applyFromArray($styleArray);
		$objPHPExcel->getActiveSheet()->getStyleByColumnAndRow($col+8,$row)->applyFromArray($styleArray);
	    $objPHPExcel->getActiveSheet()->mergeCells('I56:J56');
		//$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn($col+5)->setWidth(15);
        
		
		/* Approval*/
		
		// Save it as an excel 2003 file
		$objWriter = IOFactory::createWriter($objPHPExcel, "Excel5");
		$file="job_order.xls";
		$objWriter->save('crm-media/data/jobs/'.$file);
		redirect('crm-media/data/jobs/'.$file,301);	
    }
}